//
//  BaseCVPresenter.swift
//  NewDelivery
//
//  Created by 天下宅 on 2016/11/9.
//  Copyright © 2016年 天下宅. All rights reserved.
//

import Foundation
import UIKit
class BaseCVPresenter: NSObject,UICollectionViewDelegate,UICollectionViewDataSource{
    unowned var collectionView: UICollectionView
    unowned var vc:BaseVC
    var contents:[Any]?

    
    convenience init(WithCV cv:UICollectionView, cvc:BaseVC) {
        self.init(cv,cvc:cvc)
        self.setupCollectionView()
    }
    
    init(_ cv:UICollectionView, cvc:BaseVC) {
        collectionView = cv
        vc = cvc
    }
    
    func setupCollectionView()  {
        collectionView.delegate = self
        collectionView.dataSource = self
        collectionView.reloadData()
    }
    
    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
        return (self.contents?.count ?? 0) + 1
    }
    
    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
        
    }
    
    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
        return UICollectionViewCell()
    }
    
    
    
}
